#!/bin/bash
#
# Description: Workaround for vlc 2.0.1 (<=)  subtitle autodetection problem.
#
# Info: http://xubuntugeek.blogspot.com/2012/05/fix-vlc-20-subtitle-autodetection.html
#
# Author: Wilson Santos (wilson.bl.santos@gmail.com)
#
# Version: 1.0

subpath="$(dirname "$1")/Subtitles,$(dirname "$1")/subtitles"
echo $subpath
if [ "$subpath" == "./Subtitles,./subtitles" ]; then
  subpath="$PWD/Subtitles,$PWD/subtitles"
fi
/usr/bin/vlc --sub-autodetect-path="$subpath" "$@"
